/*
  Morse.h - Library for flashing Morse code.
  Created by David A. Mellis, November 2, 2007.
  Released into the public domain.
*/
#ifndef MouseKA8_h
#define MouseKA8_h

#include "Arduino.h"
#define RESOLUTION 0x04
#define SLEEP_MODE 0xB8 //(default 0xB8) no sleep 0xA0
#define NOISE_FILTER 0x02

#define DELAY 500


#define reg_Product_ID_1 0x00
#define reg_Product_ID_2 0x01
#define reg_Motion_Status 0x02
#define reg_Delta_X 0x03
#define reg_Delta_Y 0x04
#define reg_Operation_Mode 0x05
#define reg_Configuration 0x06
#define reg_Image_Quality 0x07
#define reg_Operation_State 0x08
#define reg_Write_Protect 0x09
class MouseKA8
{
  public:
    MouseKA8(int pinSDA,int pinSCL);
    void init_reg();
    uint8_t read_reg(uint8_t reg);
    void write_reg(uint8_t reg, uint8_t data);
    int convTwosComp(int b);
short position();
  private:
    int _pinsda;
    int _pinscl;


};

#endif